﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;


namespace WindowsFormsApplication1
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (File.Exists(txtFileName.Text) == false)
            {
                MessageBox.Show("文件不存在");
                return;
            }
            File.Copy(txtFileName.Text, txtCopyName.Text);
            MessageBox.Show("复制成功");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (File.Exists(txtDelName.Text) == false)
            {
                MessageBox.Show("文件不存在");
                return;
            }
            File.Delete(txtDelName.Text);
            MessageBox.Show("删除成功");
        }
    }
}
